Set Junit5 as default test engine #1187
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Kind of change
Description
What is the goal of this pull request?
Make JUnit5 de default testing framework.
Not possible in Wilddly integration test which requires heavy Arquillian changes and the use of an Arquiliar RC version (arquillian/arquillian-core#137 (comment)).
How does it achieve that?
Sets JUnit5 as the default test engine.
Rewrites polluted tests "category" into a JUnit 5 "tag". The Tag is applied via new annotation
@Polluted
which I personally thing it's nicer that plain using the tag.Only minimal changes are done, test that can still work in "junit 4 mode" using
junit-vintage-engine
still use. But at the end only core project requires it, some minimal rewrites allowed to remove it from documentation, cli and distribution modules.Removed use of ClasspathResource Test Rule which is not compatible, currently just replaced with use of ClasspathHelper + initializations in each test, I may refactor better when I get some extra time. I want to reduce boilerplate with a junit5 extension in another PR (see checklist).
Restrict codenarc configuration to only required modules
Other changes
codenarc
configuration did not override the Groovy version in use, I applied it viaconstraint
. It can be validated by listing dependencies for codenarc configuration (./gradlew :module:dependencies
).Are there any alternative ways to implement this?
Maybe go for "big bang" but I'd rather not do that. We can get something working, merge, and then migrate over time, next way we are removing the use of deprecated methods from tests when we need to review them.
Are there any implications of this pull request? Anything a user must know?
No
Issue
Related to #1186, we'll see how far we can get to completion in this one PR. 🤞
Release notes
Please add a corresponding entry to the file CHANGELOG.adoc
Added a note to the change just in case someone follows the repo and wants to see what's going on, I will update with the next PR when all is done and we can consider the migration completed.